<ul class="menu">
    <?php foreach ($this->get_data('menu_items') as $item) :?>
    <li>
        <a href="<?php echo tos_router_url(array('m' => $item['m'], 'a' => $item['a'], 'url'=> $item['url']));?>"><?php echo $item['caption']?></a>
        <?php if (isset($item['children'])):?>
        <div class="sub box">
        <?php tos_view('tos/menu', array('menu_items' => $item['children']))->display();?>
        </div>
        <?php endif;?>
    </li>
    <?php endforeach;?>
</ul>